#define _CRT_SECURE_NO_WARNINGS 1


#include "Queue.h"


void LevelOrder(BTNode* root)
{
	Queue q;
	QueueInit(&q);

	if (root)
		QueuePush(&q, root);

	while (!QueueEmpty(&q))
	{
		BTNode* front = QueueFront(&q);
		printf("%d", front->data);

		QueuePop(&q);
		if (front->left)
			QueuePush(&q, front->left);
		if (front->right)
			QueuePush(&q, front->right);
	}
	printf("\n");
	QueueDestory(&q);
}


int main()
{
	BTNode* root = CreatBinaryTree();
	LevelOrder(root);
	return 0;
}